package cn.tedu.ttl.common.response;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor//Lombok注解，自动生成包含所有构造参数的全参构造函数
@NoArgsConstructor//Lombok注解，自动生成一个无参构造函数
public enum StatusCode {

    SUCCESS(1000, "ok"),
    NOT_LOGIN(1001, "未登录"),
    LOGIN_SUCCESS(1002, "登录成功"),
    USERNAME_ERROR(1003, "用户名错误"),
    PHONE_ERROR(1004, "手机号错误"),
    EMAIL_ERROR(1005, "邮箱错误"),
    PASSWORD_ERROR(1006, "密码错误"),
    USERNAME_ALREADY_EXISTS(1007, "用户名已被占用"),
    PHONE_ALREADY_EXISTS(1008, "手机号已被占用"),
    EMAIL_ALREADY_EXISTS(1009, "邮箱已被占用"),
    ERROR_BAD_REQUEST(40000, "请求参数错误"),
    ERR_JWT_EXPIRED(50000),
    ERR_VIS(50000),
    ERR_JWT_MALFORMED(46000),
    ERROR_UNKNOWN(45000),
    ERROR_UNAUTHORIZED_DISABLED(470000),
    OPERATION_SUCCESS(2001, "操作成功"),
    OPERATION_FAILED(2002, "操作失败"),
    VALIDATE_ERROR(3002),     //验证失败
    NOT_FOUND_ERROR(4001);    //未找到错误

    StatusCode(Integer code) {
        this.code = code;
    }

    //自定义内部状态码
    private Integer code;
    //状态码的含义
    private String msg;
}
